package day05;

import java.util.Random;

public class MethoDemo2 {
    public static void main(String[] args) {
        /*int a = sum(5,6);
        System.out.println(a);*/
       /* a++;
        int b = a;
        System.out.println(a);*/
       /* int m=5,n=6;
        int b = sum(m,n);
        System.out.println(b);*/

        int[] d=generateArray(5,20);
        System.out.println("数组的长度："+d.length);
        for(int k=0;k<d.length;k++){
            System.out.println(d[k]);
        }
        System.out.println("====================");

        int[] c=generateArray(5,20);
        System.out.println("数组的长度："+c.length);
        for(int i=0;i<c.length;i++){
            System.out.println(c[i]);
        }

    }





    public static int[] generateArray(int len,int max){
        Random rand = new Random();
        int[] arr = new int[len];
        for(int i=0;i<arr.length;i++){
            arr[i] = rand.nextInt(max+1);
        }
        return arr;

    }


   /* public static int sum(int num1,int num2){
        int num = num1+num2;
        return num;
        //return num1+num2;
    }*/


}
